package cn.tedu.mybatisannotation.mapper;

import cn.tedu.mybatisannotation.pojo.User;
import cn.tedu.mybatisannotation.pojo.UserVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    @Insert("INSERT INTO user VALUES (NULL,#{username},#{password},#{nickname},#{created})")
    void insert(User user);

    @Select("SELECT username,password FROM user WHERE id<#{id}")
    List<UserVO> selectByUser(int id);
}
